package homework_06;

/**
 * 矩形类
 */
public class Rectangle {
    int length;
    int width;

    public Rectangle(){

    }

    public Rectangle(int width, int length){
        this.length = length;
        this.width = width;
    }

    public int getArea(){
        int area = width * length;
        return area;
    }

    public int getPer(){
        int per = (length + width) * 2;
        return per;
    }

    public void showAll(){
        System.out.println("该矩形长为"+length+",宽为"+width+",面积为"+getArea()+",周长为"+getPer());
    }
}
